package com.aiyige.page.publish.majorcourse.adapter;

import android.view.View;
import android.widget.TextView;

import com.aiyige.R;
import com.aiyige.page.publish.majorcourse.model.MajorCourseType;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.LinkedList;

import butterknife.BindView;
import butterknife.ButterKnife;

public class MajorCourseTypeAdapter extends BaseQuickAdapter<MajorCourseType, MajorCourseTypeAdapter.ViewHolder> {


    public MajorCourseTypeAdapter() {
        super(R.layout.major_course_type_item, new LinkedList<MajorCourseType>());
    }

    @Override
    protected void convert(ViewHolder helper, MajorCourseType item) {
        helper.bindData(item);
    }


    public class ViewHolder extends BaseViewHolder {
        @BindView(R.id.titleTv)
        TextView titleTv;

        public ViewHolder(View view) {
            super(view);
            ButterKnife.bind(this, view);
        }

        public void bindData(MajorCourseType data) {
            titleTv.setText(data.getTitle());
            titleTv.setSelected(data.isSelected());
        }
    }

}
